import json
import os

def save_config(country, config):
    # 确保data目录存在
    os.makedirs('data', exist_ok=True)
    with open(f'data/config_{country}.json', 'w') as f:
        json.dump(config, f, indent=2)

def load_config(country):
    try:
        with open(f'data/config_{country}.json', 'r') as f:
            return json.load(f)
    except FileNotFoundError:
        return {}

if __name__ == '__main__':
    save_config('VN', {'country': 'VN'})
    print(load_config('VN'))